package Com.Isman.Booking;

import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;

public class HotelPreference extends PreferenceActivity {
	
	ListPreference currencyPref;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preference);
		
		currencyPref = (ListPreference)findPreference("currencyPref");
		currencyPref.setSummary(PreferenceManager.getDefaultSharedPreferences(this).getString("currencyPref", "US Dollar."));
		currencyPref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {	
			@Override
			public boolean onPreferenceChange(Preference preference, Object newValue) {
				//currencyPref.setSummary((CharSequence) newValue);
				preference.setSummary((CharSequence) newValue);
				return true;
			}
		});
	}
}
